package com.leyou.gateway.web;

import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 虎哥
 */
@RestController
@RequestMapping("hystrix")
public class FallbackController {

    @RequestMapping("fallback")
    public ResponseEntity<String> fallback(){
        // 响应行（状态码）、响应头、响应体（消息）
        return ResponseEntity.status(HttpStatus.GATEWAY_TIMEOUT).body("服务器太忙了，请稍后再试！");
        // return new ResponseEntity<>("", HttpStatus.GATEWAY_TIMEOUT);
    }
}
